//点击空白的地方执行事件
document.onclick=function(){
    $("#userinfo-dropdown,#kj-dropdown,.avatar-img-contain").removeClass("show");
}
/**
 * tab的显示和隐藏的处理
 * @param {*} $this 事件的this
 * @param {*} $targetClass  tab触发所在的类选择器
 * @param {*} $thisShowClass  显示和隐藏的类名
 * @param {*} $thisContentClass   显示的具体内容的类选择器
 */
function onTabChange($this,$targetClass,$thisShowClassName,$thisContentClass){
    $($targetClass).removeClass($thisShowClassName);
    $($this).find("a").addClass($thisShowClassName);
    $index=parseInt($($this).index());
    $($thisContentClass).css("display","none").eq($index).css("display","");
}
//阻止冒泡事件
function stopBubble(e) { 
    if (e && e.stopPropagation) {
        e.stopPropagation(); 
    }else {
        window.event.cancelBubble = true; 
    }
}
function onSingleShow($targetClass,$targetShowClassName,e){
    if($($targetClass).hasClass($targetShowClassName)){
        $($targetClass).removeClass($targetShowClassName);
    }else{
        $($targetClass).addClass($targetShowClassName);
    }
    stopBubble(e);
}

function onSigleSelfShow($this,$targetClass,$targetClassName){
    if($($this).hasClass($targetClassName)){
        $($this).removeClass($targetClassName)
    }else{
        $($targetClass).removeClass($targetClassName);
        $($this).addClass($targetClassName)
    }
    
}

function onSelectTargetAvatar($this,e){
    stopBubble(e);
}
